package com.gxm.base.annotaion;

import java.lang.reflect.Method;

//注解演示
@MinAnnotation (annotationAttr=@MetaAnnotation("flx"),color="red",value="abc",arrayAttr=1)
public class AnnotationTest {

    @SuppressWarnings("deprecation")
    @MinAnnotation("xyz")
    public static void main(String[] args) throws NoSuchMethodException {
        System.runFinalizersOnExit(true);
        if(AnnotationTest.class.isAnnotationPresent(MinAnnotation.class)){
            MinAnnotation annotation = (MinAnnotation)AnnotationTest.class.getAnnotation(MinAnnotation.class);
            System.out.println(annotation.color());
            System.out.println(annotation.value());
            System.out.println(annotation.arrayAttr().length);
            System.out.println(annotation.lamp().nextLamp().name());
            System.out.println(annotation.annotationAttr().value());
        }

        Method mainMethod = AnnotationTest.class.getMethod("main", String[].class);
        MinAnnotation annotation2 = (MinAnnotation)mainMethod.getAnnotation(MinAnnotation.class);
        System.out.println(annotation2.value());
    }
    @Deprecated
    public static void sayHello(){
        System.out.println("过时注解演示");
    }
}
